package com.wish233.wrpcspringbootstarter.annotation;

import com.wish233.constant.RpcConstant;
import com.wish233.loadbalance.LoadBalancerKeys;
import com.wish233.retry.RetryStrategyKey;
import com.wish233.tolerant.TolerantStrategy;
import com.wish233.tolerant.TolerantStrategyKeys;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * @author WHH
 */
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
public @interface WrpcReference {

    /**
     * class类
     * @return
     */
    Class<?> referenceClass() default void.class;

    /**
     * 版本
     * @return
     */
    String version() default RpcConstant.DEFAULT_SERVICE_VERSION;

    /**
     * 是否启用mock
     * @return
     */
    boolean mock() default false;

    /**
     * 负载均衡器
     * @return
     */
    String loadBalancer() default LoadBalancerKeys.ROUND_ROBIN;

    /**
     * 重试策略
     * @return
     */
    String retryStrategy() default RetryStrategyKey.NO_RETRY_STRATEGY;

    /**
     * 容错机制
     * @return
     */
    String tolerantStrategy() default TolerantStrategyKeys.FAIL_FAST;
}
